You are here: Trading System Programming > Reference > Classes > Account > Account Methods > getOrders

getOrders

The getOrders method returns an array of Order objects representing all of currently open orders.

Syntax

var getOrders();

Return Value

This method returns an array of all open orders.

Example

The following example demonstrates the use of getOrders() method.

 

function start()

{

//retrieve account's open orders

var account = getAccount();

var openOrders = account.getOrders();

 

//loop through all orders

for(var i = 0; i < openOrders.length, i++)

{

var order = openOrders[i];

 

//if order is a market order, do not process it

if(order.getOrderType() == ORDERTYPE_MARKET)

continue;

 

//continue with the rest of order types...

}

 

//proceed further...

}

See Also

start(), getAccount(), Order class

 


Copyright © 2006-2009 ActiveTick LLC